package com.sgb.kjwl.viewmodel.manage

import androidx.lifecycle.MutableLiveData
import com.sgb.kjwl.api.APIManager
import com.swgk.core.base.api.ICallBack
import com.sgb.kjwl.model.entity.manage.GroupDetailEntity
import com.sgb.kjwl.view.ui.activity.manage.WebSiteGroupActivity
import com.swgk.core.base.BaseViewModel
import com.swgk.core.base.model.entity.BaseEntity

class WebSiteGroupModel constructor(activity : WebSiteGroupActivity): BaseViewModel() {

    private var mActivity : WebSiteGroupActivity ? = null
    var mGroupDetailEntity = MutableLiveData(GroupDetailEntity())
    init {
       mActivity = activity
    }


    fun getGroupDetail(){
       APIManager.getInstance().websiteInfoAPI.groupDetail.enqueue(object : ICallBack<BaseEntity<GroupDetailEntity>>(){
           override fun onSuccess(data: BaseEntity<GroupDetailEntity>?) {
               if (data != null && data.data != null){
                   mGroupDetailEntity.postValue(data.data)
               }
           }
       })
    }

}